package com.founder.gateway.orm.fzapi.bean.entity;

import com.founder.gateway.orm.fzapi.bean.dto.UserDto;
import com.founder.gateway.orm.fzapi.bean.mapper.UserMapper;
import com.founder.gateway.system.bean.DbConnStructure;
import com.sun.org.glassfish.gmbal.Description;
import org.setu.framework.annotation.description.SetuDescription;
import org.setu.framework.bean.EntityBean;
import org.setu.framework.jdbc.annotation.TableInfo;

import javax.persistence.*;
import java.util.List;

/******************************************************************************
 * @Package: [com.founder.gateway.orm.fzapi.bean.entity.UserEntity]
 * @ClassName: [UserEntity]
 * @Description: [一句话描述该类的功能]
 * @Author: [fengli@founder.com.cn]  
 * @CreateDate: [2019/1/11 10:50]   
 * @UpdateUser: [fengli@founder.com.cn (如多次修改保留历史记录，增加修改记录)]   
 * @UpdateDate: [2019/1/11 10:50，(如多次修改保留历史记录，增加修改记录)]   
 * @UpdateRemark: [说明本次修改内容, (如多次修改保留历史记录 ， 增加修改记录)]
 * @Version: [v1.0]
 * ${tags}
 */
@Entity
@Table(name = "user")
@TableInfo(dbConn = DbConnStructure.DC$GATEWAY, dbName = DbConnStructure.fz_api)
public class UserEntity extends EntityBean<UserEntity, UserDto, UserMapper> {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "UUIDGenerator")
    @Column(name = "id", length = 32, nullable = false, columnDefinition = "varchar")
    @SetuDescription(describe = "用户id")
    private String id;

    @Column(name = "user",length=255,nullable=false,columnDefinition="varchar")
    @SetuDescription(describe = "用户账号")
    private String user;

    @Column(name = "password",length=255,nullable=false,columnDefinition="varchar")
    @SetuDescription(describe = "用户密码")
    private String password;

    @OneToMany(mappedBy = "userId")
    List<BlogEntity> blogs;

    public List<BlogEntity> getBlogs() {
        return blogs;
    }

    public void setBlogs(List<BlogEntity> blogs) {
        this.blogs = blogs;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}
